﻿
namespace SwtorCalculator {
    using System.Windows.Controls;

    /// <summary>
    /// Interaction logic for ProgressControl.xaml
    /// </summary>
    public partial class ProgressControl : UserControl {
        public ProgressControl() {
            InitializeComponent();
        }

        internal string TitleText {
            set {
                if( value != null )
                    TitleLabel.Content = value;
                else
                    TitleLabel.Content = string.Empty;
            }
        }

        internal double MaxCount {
            get { return this.Progress.Maximum; }
            set {
                if( value != null && value > this.Progress.Minimum )
                    this.Progress.Maximum = value;
            }
        }

        internal double MinCount {
            get { return this.Progress.Minimum; }
            set {
                if( value != null && value < this.Progress.Maximum )
                    this.Progress.Maximum = value;
            }
        }

        internal double Current {
            get { return this.Progress.Value; }
            set {
                if( value != null && value >= this.Progress.Minimum && value <= this.Progress.Maximum )
                    this.Progress.Value = value;
            }
        }
    }
}
